﻿using UnityEngine;
using System.Collections;
using KingSley;

public class PlayerStaticAttributeData : MonoSingleton<PlayerStaticAttributeData>
{
    /// <summary>
    /// 初始基础属性
    /// </summary>
    private BaseAttribute tempBaseStatus = new BaseAttribute
    {
        LV = 1,
        HP = 200,
        MP = 50,
        Attack = 30,
        Defend = 10,
        Strong = 5,
        Intelligence = 5,
        Agility = 5,
        Power = 5,
        AttackSpeed = 1,
        MoveSpeed = 2,
        RotationSpeed = 4,
        AttackRange = 3,
        Exp = 0,
        CriticalRate = 1,
        CriticalDamage = 110,
        HPRecoverPerSecond = 1,
        MPRecoverPerSecond = 1
    };
    /// <summary>
    /// 初始附加属性
    /// </summary>
    private AdditionAttribute tempAddStatus = new AdditionAttribute
    {
        HP = 0, MP = 0,
        Attack = 0,
        Defend = 0,
        Strong = 0,
        Intelligence = 0,
        Agility = 0,
        Power = 0,
        AttackSpeed = 0,
        MoveSpeed = 0,
        RotationSpeed = 0,
        AttackRange = 0,
        CriticalRate = 0,
        CriticalDamage = 0,
        HPRecoverPerSecond = 0,
        MPRecoverPerSecond = 0
    };
    /// <summary>
    /// 初始当前属性也就是初始的基础属性
    /// </summary>
    private CurAttribute tempCurStatus = new CurAttribute
    {
        CurHP = 200,
        CurMP = 50,
        CurAttack = 30,
        CurDefend = 10,
        CurStrong = 5,
        CurIntelligence = 5,
        CurAgility = 5,
        CurPower = 5,
        CurAttackSpeed = 1,
        CurMoveSpeed = 2,
        CurRotationSpeed = 4,
        CurAttackRange = 3,
        CurCriticalRate = 1,
        CurCriticalDamage = 110,
        HPRecoverPerSecond = 1,
        MPRecoverPerSecond = 1
    };
    /// <summary>
    /// 初始升级属性
    /// </summary>
    private AttributeGrowth tempAttributeGrowth = new AttributeGrowth
    {
        HP = 10,
        MP = 3,
        Attack = 2,
        Defend = 1,
        Strong = 2,
        Intelligence = 1,
        Agility = 1,
        Power = 2,
    };
    /// <summary>
    /// 升级属性叠加量
    /// </summary>
    private AttributeGrowth tempGrowthPoint = new AttributeGrowth
    {
        HP = 1,
        MP = 0.5F,
        Attack = 0.2F,
        Defend = 0.1F,
        Strong = 0.2F,
        Intelligence = 0.1F,
        Agility = 0.1F,
        Power = 0.2F,
    };
    /// <summary>
    /// 初始总属性也就是初始的基础属性
    /// </summary>
    private SumAttribute tempSumStatus = new SumAttribute
    {
        HP = 200,
        MP = 50,
        Attack = 30,
        Defend = 10,
        Strong = 5,
        Intelligence = 5,
        Agility = 5,
        Power = 5,
        AttackSpeed = 1,
        MoveSpeed = 2,
        RotationSpeed = 4,
        AttackRange = 3,
        CriticalRate = 1,
        CriticalDamage = 110,
        HPRecoverPerSecond = 1,
        MPRecoverPerSecond = 1
    };
    /// <summary>
    /// 初始化所有角色属性控制器变量初始值
    /// </summary>
    private void Start()
    {
        PlayerAttributeControl.Instance().BaseStatus = tempBaseStatus;
        PlayerAttributeControl.Instance().AddStatus = tempAddStatus;
        PlayerAttributeControl.Instance().CurStatus = tempCurStatus;
        PlayerAttributeControl.Instance().attributeGrowth = tempAttributeGrowth;
        PlayerAttributeControl.Instance().growthPoint = tempGrowthPoint;
        PlayerAttributeControl.Instance().SumStatus = tempSumStatus;
        PlayerAttributeControl.Instance().MaxLV = 70;
        PlayerAttributeControl.Instance().RunSpeed = 4;
        PlayerAttributeControl.Instance().WalkSpeed = 2;
        PlayerAttributeControl.Instance().TurnSpeed = 2;
        PlayerAttributeControl.Instance().BackSpeed = 2;
    }

    private void Update()
    {
        PlayerAttributeControl.Instance().UpdateAttribute();
    }
}